<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="com.mytrip.util.PageInfo" import="com.mytrip.model.Trip" import="java.util.*" import="java.text.SimpleDateFormat" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>出发吧</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="/common/include_js.jsp" />
<link rel="stylesheet" type="text/css" media="screen" href="<%=request.getContextPath() %>/front/css/css.css" />
</head>
<body>
<div id="wrap">
  <jsp:include page="include/top.jsp">
  	<jsp:param name="t" value="2" />
  </jsp:include>

  <div id="main">
  	<jsp:include page="include/myTrip-left.jsp">
  		<jsp:param name="t" value="2" />
  	</jsp:include>
  	
    <div class="fRt rightBar">
      <div class="breadcrumb">您现在的位置：<a href="<%=request.getContextPath() %>/front/home.action">出发吧</a> > <a href="<%=request.getContextPath() %>/front/trip!showNextTrip.action">我的行程</a>> 行程列表</div>
      <div class="title">
        <div class="tlText">过期的行程</div>
      </div>
      <div class="stdHPad dubVMrgT">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <%
        	PageInfo<Trip> pageInfo = (PageInfo<Trip>)request.getAttribute("page");
        	List<Trip> dataList = pageInfo.getDataList();
        	
        	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        	for(Trip trip : dataList){
        		Date startDate = trip.getStartDate();
        		Date endDate = trip.getEndDate();
        		long a = (endDate.getTime()-startDate.getTime())/(1000*60*60*24)+1;
        %>
          <tr>
            <td><img src="<%=request.getContextPath() %><%=trip.getPhoto()%>" width="31" height="29" /></td>
            <td><div style="min-height:35px"> <a href="javascript:void(0);" onclick="window.location.href='<%=request.getContextPath() %>/front/trip!detail.action?id=<%=trip.getId()%>';"><%=trip.getName()%></a>&nbsp;(<%=a%> 天) <span style="color:red;"><%if(!"1".equals(trip.getIsPublic())){out.print("私有行程");}%></span><br>
                <span class="fntXS curPtr"><%=trip.getFromCityStr()%> ~ <%=trip.getToCityStr()%></span>
                <div > <span >通知成员数</span>: <%=trip.getNotifyUserList().size()%> </div>
              </div></td>
            <td><div style="white-space: nowrap;"><%=sdf.format(startDate)%> ~ <%=sdf.format(endDate)%></div></td>
            <td style="text-align:right;"><a href="javascript:void(0);" onclick="window.location.href='<%=request.getContextPath() %>/front/trip!detail.action?id=<%=trip.getId()%>';">查看</a>&nbsp;<a href="javascript:void(0);" onclick="if(confirm('确认删除该行程?')){window.location.href='<%=request.getContextPath() %>/front/trip!delete.action?id=<%=trip.getId()%>'}">删除</a></td>
          </tr>
          <tr>
            <td  colspan="4"><div class="dot"></div></td>
          </tr>
        <%
        	}
        %>
          <tr>
          	<td colspan="4">
          		<%=pageInfo.getHtml()%>
          	</td>
          </tr>
        </table>
      </div>
    </div>
  </div>
  
  <jsp:include page="include/bottom.jsp" />
</div>

</body>
</html>